@echo off<nul 3>nul

:start
wmic process get commandline,processid | findstr "daemon.bat" | findstr /v findstr >nul 1>nul && goto step0 || goto step1
:step0
wmic process where "name='cmd.exe'" get commandline,processid |find /i  "daemon.bat" >temp.txt 
::wmic process get commandline,processid | findstr "daemon.bat" | findstr /v findstr >temp.txt 
for /f tokens^=2^ delims^=^" %%i in (temp.txt) do set value=%%i 
set value=%value:~-20%
echo kill daemon pid:%value%
taskkill /f /pid %value%
del -rf temp.txt

:step1
tasklist | find /i "yt_fd2.exe" >nul 2>nul && goto kill || goto exit

:kill
TASKKILL /F /IM yt_fd2.exe
goto start

:exit
echo yt_fd2.exe is killed
ping -n 2 127.0.0.1>nul
exit